<?php
require('common/common.php');
User::initialize(db_connect());
$Input = new Input();
$username = $Input->get('username',Input::RAW);
try {
    if (isset($username)) $pw = User::reset_pw($username);
} catch (Exception $e) {
}
?>
<!DOCTYPE html>
<HTML><head>
    <title>Password Reset</title>
</head>
<body>
    <div id="header"></div><br>
    <div id="main"><?php
        if (isset($username)) {
            if (isset($pw)) { echo "<h3>Password Reset for $username</h3>" .
                                    "<p>Email Sent!  j/k, it's (".htmlspecialchars($pw).")<br />"; }
            else { echo "unknown username $username"; }
        }
    ?>
    <h2>Enter username to reset</h2>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
        <label>Username: </label><input type="text" name="username" ><br>
        <input type="submit">
    </form>
    </div>
</body></HTML>
